<?php
namespace Home\Controller;
use Think\Controller;
class CommonController extends Controller {

	//400 错误请求页面
	public function BadRequest(){
		$this->display('400');
	}
    

    public function Login(){

    	$m_websetup = M('Websetup');
    	$where['name'] = 'webname';

    	$webname = $m_websetup->where($where)->getfield('value');

    	$this->assign('webname',$webname);

    	$this->display();
    }


    public function ctrl_Login(){
    	if (IS_AJAX) {
    		$username = trim($_REQUEST['username']);
    		$password = trim($_REQUEST['password']);

    		$this->ajaxReturn(array(
                'code'=>100,
                'msg' => '登录成功'
            ));
    	}else{
    		$this->redirect('Common/BadRequest');
    	}
    }



}